﻿@model List<OneToManyEntityFramework.Model.Album>
<!-- a is each album -->
@foreach (var a in Model)
{
    <div class="well">
        @a.Name <br />
        <i>@a.Artist</i> <br />
        <table>
            <tbody>
                <!-- d is each song in the album -->
                @foreach (var d in a.Songs)
                {
                    <tr>
                        <td> @d.Title </td>
                        <td> @d.DateReleased</td>
                    </tr>
                }
            </tbody>
        </table>
        @Html.ActionLink("Details", "Details", new { id = a.AlbumId }, new { @class = "btn btn-primary" })
        @Html.ActionLink("Delete Album", "DeleteAlbum", new { id = a.AlbumId }, new { @class = "btn btn-primary" })
    </div>
}